<html>
	<head>
		<title>nest.js test page</title>
		<link rel="stylesheet" type="text/css" href="style/stylesheet.css" />
		<script type="text/javascript" src="script/beautify.js"></script>
		<!--[if IE]>
		<script type="text/javascript" src="script/json2.js"></script>
		<![endif]-->
		<script type="text/javascript" src="../src/nest.js"></script>
		<script type="text/javascript">
			window.onload = function() {

				var GrammarConstructor = njs.define(function() {

					element('define').sequence('string')(
						element('code').sequence('number'),
						element('codeset').sequence('number', 'number'),
						element('charset').sequence('string', 'string'),
						element('buffer').sequence('string'),
						element('choose').sequence(
							element('when'),
							element('then')
						)
					)

				});

				document.getElementById('textarea').value = js_beautify(
					JSON.stringify(GrammarConstructor),
					{'indent_size': 4}
				);
			}
		</script>
	</head>
	<body>
		<textarea id="textarea" readonly="true"></textarea>
	</body>
</html>